import 'package:flutter/material.dart';
import 'package:yurun_smartmerchants/res/colours.dart';


class SalesAccountPage extends StatefulWidget {

  @override
  _SalesAccountPageState createState() => _SalesAccountPageState();
}

class _SalesAccountPageState extends State<SalesAccountPage>  with SingleTickerProviderStateMixin {
  TabController _tabController;
  List<String> titles = ["待理货", "已理货"];

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: titles.length, vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    _tabController.dispose();
  }



  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        primary: true,
        brightness: Brightness.light,
        title: Text(
            '销售台账',
            style: TextStyle(fontSize: 18, color: Colours.app_words)
        ),
        backgroundColor: Colours.title_bg,
        iconTheme: IconThemeData(color: Colours.app_words),
        bottom: TabBar(
          tabs: <Widget>[
            Tab(
              text: titles[0],
            ),
            Tab(
              text: titles[1],
            ),
          ],
          controller: _tabController,
          indicatorColor: Colours.color_dd4b39,
          labelColor: Colours.color_dd4b39,
          unselectedLabelColor: Colours.color_434343,
          indicatorSize: TabBarIndicatorSize.label,
          indicatorWeight: 2,
          onTap: (index) {

          },
        ),
      ),
      body: Text('Hi'),
    );

  }

}